import router from './router'
import store from '@/store'

var login=false;
var white=['/']
router.beforeEach((to, from, next) => {
    console.log("运行全局前置守卫")
    console.log('从%s到%s', from.fullPath, to.fullPath)
    const{meta}=to
    console.log(meta)
    store.commit('SETTING_HEADER',meta.header)
    if(meta.admin){
        next({
            path:'/Dynamic'
        })
        return;
    }
    // if (login ||white.indexOf(to.fullPath)!==-1) {
    //     return next()
    // }
    next()
})
